package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.bdmc.common.annotation.FieldMeta;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 缆段点 实体
 * </p>
 *
 * @author ping
 * @since 2020-07-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
// "FibreCablePoint对象", description = "缆段点")
public class FibreCablePoint extends Model<FibreCablePoint> {

    private static final long serialVersionUID = 1L;

    // "自增id")
    @TableId(value = "point_id", type = IdType.AUTO)
    private Integer pointId;

    // "光缆id")
    @FieldMeta(name = "光缆id", description = "光缆id")
    private Integer fibreId;

    // "部门id")
    @FieldMeta(name = "部门id", description = "部门id")
    private Integer deptId;

    // "设施编码")
    @FieldMeta(name = "设施编码", description = "设施编码")
    private String pointCode;

    // "设施名称")
    @FieldMeta(name = "设施名称", description = "设施名称")
    private String pointName;

    // "缆段序号")
    @FieldMeta(name = "缆段序号", description = "缆段序号")
    private Integer serialNum;

    // "缆段类型(1标石2人井3接头4电杆5机房6光缆配线架7光缆分歧点8穿越点9管道10光缆交接箱11地埋)")
    @FieldMeta(name = "缆段类型(1标石2人井3接头4电杆5机房6光缆配线架7光缆分歧点8穿越点9管道10光缆交接箱11地埋)", description = "缆段类型(1标石2人井3接头4电杆5机房6光缆配线架7光缆分歧点8穿越点9管道10光缆交接箱11地埋)")
    private Integer pointType;

    // "规格")
    @FieldMeta(name = "规格", description = "规格")
    private String norm;

    // "缆段经度")
    @FieldMeta(name = "缆段经度", description = "缆段经度")
    private String lng;

    // "缆段纬度")
    @FieldMeta(name = "缆段纬度", description = "缆段纬度")
    private String lat;

    // "预留纤长(m)")
    @FieldMeta(name = "预留纤长(m)", description = "预留纤长(m)")
    private BigDecimal obligateLength;

    // "距起点纤长(km)")
    private BigDecimal origoLength;

    // "距前一缆段gps距离(m)")
    private BigDecimal frontGpslength;

    // "距起点缆段gps距离(km)")
    private BigDecimal origoGpslength;

    // "gps验证(1是0否)")
    private Integer gpsstatus;

    // "备注")
    private String remark;

    // "是否是关键点")
    private Boolean keyPoint;

    // "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    // "创建人")
    private String createBy;

    @TableField(exist = false)
    private String fibreName;

    @Override
    public Serializable pkVal() {
        return this.pointId;
    }

}
